package cn.bluedot.tea.util;

import java.util.ArrayList;
import java.util.List;

public class Mail {

	private String from;//发件人
	private StringBuilder to = new StringBuilder();//收件人
	private StringBuilder cc = new StringBuilder();//抄送人
	private StringBuilder bcc = new StringBuilder();//暗送人
	
	private String subject; //主题
	private String content; //正文
	//附件集合
	private List<MailUtils.AttachFile> AttachFile = new ArrayList<MailUtils.AttachFile>();
	
	public Mail() {}

	
	public Mail(String from, StringBuilder to, String subject, String content) {
		super();
		this.from = from;
		this.to = to;
		this.subject = subject;
		this.content = content;
	}


	public String getFrom() {
		return from;
	}


	public void setFrom(String from) {
		this.from = from;
	}

	public void addTo(String to) {
		if(this.to.length() > 0) {
			this.to.append(",");
		}
		this.to.append(to);
	}
	
	public String getTo() {
		return to.toString();
	}


	public String getCc() {
		return cc.toString();
	}


	public void setCc(StringBuilder cc) {
		this.cc = cc;
	}


	public String getBcc() {
		return bcc.toString();
	}


	public void setBcc(StringBuilder bcc) {
		this.bcc = bcc;
	}


	public String getSubject() {
		return subject;
	}


	public void setSubject(String subject) {
		this.subject = subject;
	}


	public String getContent() {
		return content;
	}


	public void setContent(String content) {
		this.content = content;
	}

	public List<MailUtils.AttachFile> getAttachFile() {
		return AttachFile;
	}

	public void setAttachFile(List<MailUtils.AttachFile> attachFile) {
		AttachFile = attachFile;
	}
	
}
